package zz.note.rabbitmq.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * direct模式
 * @Author: ZZ
 * @date 2022/2/11
 */
@Configuration
public class DeadRabbitConfig {
	@Bean
	public DirectExchange deadExchange() {
		return new DirectExchange("dead_direct_exchange", true, false);
	}

	@Bean
	public Queue deadQueue() {
		return new Queue("dead.direct.queue", true);
	}

	@Bean
	public Binding deadBinding() {
		return BindingBuilder.bind(deadQueue()).to(deadExchange()).with("dead");
	}
}
